package org.ww.cart.service;

import org.ww.cart.vo.CartItemVo;
import org.ww.cart.vo.CartVo;

import java.util.List;
import java.util.concurrent.ExecutionException;

/**
* @program: gmall
* @description: 购物车service
* @author: ww
* @create: 2024-05-17 11:49
**/

public interface CartService {
    /**
     * 添加购物车
     * @param skuId
     * @param num
     * @return
     */
    CartItemVo addCartItem(Long skuId, Integer num) throws ExecutionException, InterruptedException;

    /**
     * 获取购物车的购物项
     * @param skuId
     * @return
     */
    CartItemVo getCartItem(Long skuId);

    /**
     * 获取购物车信息
     * @return
     */
    CartVo getCart() throws ExecutionException, InterruptedException;

    /**
     * 勾选购物项
     * @param skuId
     * @param check
     */
    void checkItem(Long skuId, Integer check);

    /**
     * 更改购物项数量
     * @param skuId
     * @param num
     */
    void countItem(Long skuId, Integer num);

    /**
     * 删除购物车项
     * @param skuId
     */
    void deleteItem(Long skuId);

    List<CartItemVo> getUserCartItems();

}
